<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/12/17
  Time: 17:04
  To change this template use File | Settings | File Templates.
--%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html" ;charset="gb2312">
    <title>CoolMeeting会议管理系统</title>
    <link rel="stylesheet" href="styles/common.css"/>
    <script>

        function beforeSubmit(form){
            if(form.userpwd.value==''){
                alert('密码不能为空！');
                form.userpwd.focus();
                return false;
            }
            if(form.newuserpwd.value==''){
                alert('新密码不能为空！');
                form.newuserpwd.focus();
                return false;
            }
            if(form.newuserpwds.value==''){
                alert('确认新密码不能为空！');
                form.newuserpwds.focus();
                return false;
            }
            if(form.userpwd.value!=${userpwd}){
                alert('原密码输入错误！');
                form.userpwd.focus();
                return false;
            }

            if(form.userpwd.value==form.newuserpwd.value) {
                alert('原密码与新密码不能一致！');
                form.userpwd.focus();
                return false;
            }
            if(form.newuserpwd.value!==form.newuserpwds.value) {
                alert('两次新密码不一致！');
                form.newuserpwd.focus();
                return false;
            }
            return true;
        }



    </script>
</head>
<body>


<div class="page-content">
    <div class="content-nav">
        修改密码
    </div>
    <form action="${pageContext.request.contextPath }/UpdateUserpwdServlet" onSubmit="return beforeSubmit(this)">
        <fieldset>
            <legend>修改密码信息</legend>

            <table class="formtable" style="width:50%">
                <tr>
                    <td>原密码:</td>
                    <td>
                        <input id="origin" type="password" name="userpwd"/>
                    </td>
                </tr>
                <tr>
                    <td>新密码:</td>
                    <td>
                        <input id="new" type="password" name="newuserpwd"/>
                    </td>
                </tr>
                <tr>
                    <td>确认新密码：</td>
                    <td>
                        <input id="confirm" type="password" name="newuserpwds"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" class="command">
                        <input type="submit" value="确认修改" class="clickbutton"/>
                        <input type="button" value="返回" class="clickbutton" onclick="window.history.back();"/>
                        <label>${msg}</label>


                    </td>
                </tr>
            </table>
        </fieldset>
    </form>
</div>

</body>
</html>
